#ifndef OPENSLES_H
#define OPENSLES_H
#include <SLES/OpenSLES.h>
#include <SLES/OpenSLES_Android.h>
class IAudioData;
class OpenSLES
{
public:
    OpenSLES();
    ~OpenSLES();
public:
   void Init(IAudioData *);
   void CreateEngine();
   void CreateBufferQueueAudioPlayer(int rate, int channel, int bitsPerSample);
   void Start();
   void Stop();
   void Destroy();

   void PlayerCallback(SLAndroidSimpleBufferQueueItf bq);
private:
   // engine interfaces
   SLObjectItf engineObject;
   SLEngineItf engineEngine;

   // output mix interfaces
   SLObjectItf outputMixObject;
   SLEnvironmentalReverbItf outputMixEnvironmentalReverb;

   // buffer queue player interfaces
   SLObjectItf      bqPlayerObject;
   SLPlayItf        bqPlayerPlay;
   SLAndroidSimpleBufferQueueItf bqPlayerBufferQueue;
   SLEffectSendItf  bqPlayerEffectSend;
   SLMuteSoloItf    bqPlayerMuteSolo;
   SLVolumeItf      bqPlayerVolume;
private:
   IAudioData   *m_oIAudioData;
   char         *audioBuf;
};

#endif // OPENSLES_H
